package com.cyq.config;


import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class ConfigApplication {

    public static void main(String[] args) throws InterruptedException {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(ConfigApplication.class, args);
        while (true) {

            String userName = applicationContext.getEnvironment().getProperty("user.name");
            String userAge = applicationContext.getEnvironment().getProperty("user.age");
            String userConfig = applicationContext.getEnvironment().getProperty("user.config");
            System.out.println("userName:" + userName + ";userAge:" + userAge + ";userConfig:" + userConfig);
            Thread.sleep(1000);
        }

    }
}
